package com.laiketui.order.service;

import com.laiketui.order.domain.Order;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * @author jiangxiang
 * @description 针对表【lk_order(订单表)】的数据库操作Service
 * @createDate 2024-08-15 23:56:36
 */
public interface OrderService extends IService<Order> {
    String ORDER_LOCK_PREFIX = "order_";

    default  String getOrderKey(String orderNo) {
        return ORDER_LOCK_PREFIX + orderNo;
    }

    List<Order> findByOrderParentNo(String orderParentNo);

    boolean updateStatusCancel(String orderParentNo);

    Order findByOrderNo(String orderNo);

    //根据子单号更新订单
    boolean updateByOrderNo(Order order, String orderNo);

    //更新子单为已完成
    boolean updateStatusFinish(String orderNo,String userId);

    boolean updateByOrderParentNo(String orderParentNo, Order order);
}
